<style lang="less">
	page{
		background: #f6f6f6;
	}
	.content {
		text-align: center;
		height: 100%;
		width: 100%;
		.main-img{
			width: 100%;
		}
	}
	.text-center{
		padding: 20upx;
		box-sizing: border-box;
		width: 100%;
		display: block;
		text-align: left;
		/deep/ img{
			width: 100%;
			height: auto;
		}
	}
</style>
<template>
	<view class="content">
		<!-- <image src='https://static.xpandago.net/wechat/images/hongdong.png' class="main-img" mode="widthFix"></image> -->
		<rich-text :nodes="dataInfo" class="text-center"></rich-text>
	</view>
</template>
<script>
	import api from '@/common/api';
	export default {
		data() {
			return {
				id:'',
				token:'',
				dataInfo:''
			}
		},
		onLoad(options) {
			this.id=options.id
			this.token=uni.getStorageSync('token')
			this.getRuleById()
		},
		//下拉刷新
		 onPullDownRefresh() {
			this.getRuleById();
			setTimeout(function () {
				uni.stopPullDownRefresh();  //停止下拉刷新动画
			}, 1000);
		},
		methods: {
			//激励规则
			async getRuleById(){
				const [err, res] = await api.getRuleById({
						query: {
							id:this.id
						},
						header:{
							'Content-Type': 'application/json',
							'token': this.token
						}
					 });
				 if(res.data.code == 0){
					 this.dataInfo=res.data.data
				 }else{
				 }
			},
		}
	}
</script>
